//
//  LineTextFieldView.m
//  RONGAO
//
//  Created by Kendama on 2018/2/26.
//  Copyright © 2018年 wei wang. All rights reserved.
//

#import "LineTextFieldView.h"

@implementation LineTextFieldView

- (UITextField *)textField
{
    if(!_textField)
    {
        UIView *superView = self;
        _textField = [[UITextField alloc]init];
        [superView addSubview:_textField];
    }
    return _textField;
}

- (void)masLayoutSubview
{
    __weak UIView *superView = self;
    
    [self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(superView.mas_centerY);
        make.left.mas_equalTo(superView.mas_left).with.offset(pxScaleWidth(60));
        make.right.mas_equalTo(superView.mas_right).with.offset(-pxScaleWidth(60));
    }];
    
    UIView *lineView = ({
        lineView = [[UIView alloc]init];
        [superView addSubview:lineView];
        lineView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1];
        [lineView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.bottom.left.right.mas_equalTo(superView);
            make.height.mas_equalTo(1);
        }];
        lineView;
        
    });
    
}

@end
